--- import translate from '$i18n/translate'; import tPage from '$i18n/translations/pages/news'; import Page from '$layouts/Page.astro'; import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; import localeStaticPaths from '$lib/localeStaticPaths'; import { getCollection } from 'astro:content'; import { isBefore, isNewsItemInLocale } from '$lib/newsUtils'; import NewsIndex from '$components/NewsIndex/NewsIndex.astro'; const allNews = await getCollection('news'); const locale = getLocaleFromPathOrThrow(Astro.url.pathname); const allNewsInLocale = allNews .filter((item) => isNewsItemInLocale(item, locale)) .sort((a, b) => (isBefore(a, b) ? 1 : isBefore(b, a) ? -1 : 0)); const t = translate(locale); export async function getStaticPaths() { return localeStaticPaths; } ---

{t(tPage, { key: 'title' })}